// pages/Goods/teamStyle/index.js
var common = require("../../../../public.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    storeId: '',
    teamList: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (opt) {
    console.log(opt.storeId)
    let that = this
    that.setData({
      storeId: opt.storeId
    }, _ => {
      that.getStoreMainPageInfoFunc()
    })
  },
  getStoreMainPageInfoFunc() {
    var that = this;
    var tempJson = {
      storeId: this.data.storeId
    };
    common.wxRequest("/store/mainPageInfo", "post", tempJson, 'application/x-www-form-urlencoded', function (res) {
      console.log('店铺返回值', res);

      that.setData({
        teamList: res.data.teamList,
        store: res.data.store
      })
    })
  },
  toTeamDetail(e) {
    let id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '/packageA/pages/Goods/teamStyle/teamDetail/index?teamId=' + id,
    })
  }
})